package lgq.xuan.httprequest.util.network;

import android.net.ConnectivityManager;
import android.net.Network;
import android.os.Build;

import androidx.annotation.RequiresApi;

public class NetworkConnectivity {

    ConnectivityManager connectivityManager;

    public NetworkConnectivity(ConnectivityManager connectivityManager) {
        this.connectivityManager = connectivityManager;
    }

    @RequiresApi(api = Build.VERSION_CODES.M)
    public void getNetworkConnect() {
        // 使用此实例获取对应用当前默认网络的引用
        Network activeNetwork = connectivityManager.getActiveNetwork();
    }

}
